{include file="public/header" /}
<link rel="stylesheet" href="/static/admin/css/login.css" media="all">
<body class="login-bg">
<div class="layadmin-user-login layadmin-user-display-show" style="z-index: 9999">

	<div class="layadmin-user-login-main" >
		<div class="layadmin-user-login-box layadmin-user-login-header">
			<h2 class="message">{:cache('system')['web_site_title']}</h2>

		</div>
		<div class="layadmin-user-login-box layadmin-user-login-body">
			<form class="layui-form" id="form">
                <div class="layui-form-item">
                    <label class="layadmin-user-login-icon layui-icon layui-icon-username"></label>
                    <input type="text" name="admin_name" lay-verify="required" lay-reqtext="请输入用户名" lay-verType="tips" placeholder="请输入用户名" autocomplete="off"  class="layui-input">
                </div>
                <div class="layui-form-item">
                    <label class="layadmin-user-login-icon layui-icon layui-icon-password" ></label>
                    <input type="password" name="password" lay-verify="required" lay-reqtext="请输入登录密码" lay-verType="tips" placeholder="请输入登录密码" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-item">
                    <div class="layui-row">
                        <div class="layui-col-xs7">
                            <label class="layadmin-user-login-icon layui-icon layui-icon-vercode" ></label>
                            <input type="text" name="captcha" lay-verify="required" lay-reqtext="请输入图形验证码" lay-verType="tips" placeholder="图形验证码" autocomplete="off"  class="layui-input">
                        </div>
                        <div class="layui-col-xs5">
                            <div style="margin-left: 10px;">
                                <img src="{:captcha_src()}" id="captcha" class="layadmin-user-login-codeimg" onclick="this.src='{:captcha_src()}?'+Math.random();">
                            </div>
                        </div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <button type="submit" class="layui-btn layui-btn-fluid" lay-submit="" lay-filter="login">登 录</button>
                </div>
			</form>

		</div>
	</div>
</div>
<div id="holder"></div>

</body>
{include file="public/footer" /}
<!--<script type="text/javascript" src="/static/admin/js/animation.js"></script>-->
<script>
    $login = location.href;
    $top = top.location.href;
    if ($top != $login) {
        top.location.href = '{:url("login/index")}';
    }
	layui.use('form', function() {
		var form = layui.form;
		form.on('submit(login)', function(data) {
		    var load = layer.load();
			$.ajax({
				type : 'POST',
				url : '{:url("login/check")}',
				data : $("#form").serialize(),
				dataType : "json",
				success : function(data) {
				    layer.close(load);
					if (data.code == 1) {
                        notify.success(data.msg,1500,function (){
                            location.href = '{:url("index/index")}';
                        });
					} else {
                        notify.error(data.msg);
						$('#captcha').attr('src','{:captcha_src()}?' + Math.random());
					}
				}
			});
			return false;
		});

	});



</script>
</html>